﻿using System;
using Castle.ActiveRecord;
using CosyTrade.Data;
using CosyTrade.Organization;

namespace CosyTrade.Distribution
{
    [AddPropertyChangedNotifyInterface, PropertyChangedNotify]
    [ActiveRecord("tabOrderPayLog"), Serializable]
    public class OrderPayLog : BusinessObject
    {
        private readonly Guid primaryKey = Guid.NewGuid();
        [PrimaryKey(PrimaryKeyType.Assigned, "ROWGUID",Access = PropertyAccess.NosetterCamelcase)]
        public override Guid PrimaryKey
        {
            get { return primaryKey; }
        }

        /// <summary>
        /// 订单
        /// </summary>
        private Guid orderGuid;
        /// <summary>
        /// 收款人    
        /// </summary>
        private Employee getPayer;
        /// <summary>
        /// 收款日期
        /// </summary>
        private DateTime payDate;
        /// <summary>
        /// 金额
        /// </summary>
        private double payMeney;

        /// <summary>
        /// 订单
        /// </summary>
        [Property]
        public Guid OrderGuid
        {
            get { return orderGuid; }
            set { orderGuid = value; }
        }

        /// <summary>
        /// 收款人    
        /// </summary>
        [BelongsTo]
        public Employee GetPayer
        {
            get { return getPayer; }
            set { getPayer = value; }
        }

        /// <summary>
        /// 收款日期
        /// </summary>
        [Property]
        public DateTime PayDate
        {
            get { return payDate; }
            set { payDate = value; }
        }

        /// <summary>
        /// 金额
        /// </summary>
        [Property]
        public double PayMeney
        {
            get { return payMeney; }
            set { payMeney = value; }
        }
    }
}
